Skip to content

refactor(ui): improve theming system and add cursor support#596

Merged
JasonXuDeveloper merged 2 commits intomasterfrom
refactor/ui-theming-improvements
Jan 29, 2026
Merged

refactor(ui): improve theming system and add cursor support#596
JasonXuDeveloper merged 2 commits intomasterfrom
refactor/ui-theming-improvements

Conversation

@JasonXuDeveloper
Copy link
Copy Markdown
Owner

Summary

  • Simplify Tokens.cs with base Palette class reducing color duplication
  • Add shared input styling methods to JTheme for consistent form controls
  • Make JDropdown generic with ForEnum<T>() factory method for enum support
  • Add JIconButton component for small transparent icon buttons
  • Add USS-based cursor styles (pointer for clickables, text for inputs)
  • Fix hover effects using PointerOverEvent/PointerOutEvent for PopupField
  • Add dynamic toggle thumb colors using Primary/Secondary tokens
  • Update BootstrapEditorUI and PanelUI to use generic components
  • Remove unused JFormSection.cs and PopupFieldStyleHelper.cs

Test plan

  • Open Bootstrap window and verify all form controls display correctly
  • Open Panel window and verify scene buttons have pointer cursor
  • Hover over dropdowns, object fields, text fields - verify hover states work
  • Click toggles - verify thumb color changes with smooth transition
  • Test in both dark and light Unity editor themes
  • Verify no compilation errors

🤖 Generated with Claude Code

- Simplify Tokens.cs with base Palette class reducing color duplication
- Add shared input styling methods to JTheme for consistent form controls
- Make JDropdown generic with ForEnum<T>() factory method for enum support
- Add JIconButton component for small transparent icon buttons
- Add USS-based cursor styles (pointer for clickables, text for inputs)
- Fix hover effects using PointerOverEvent/PointerOutEvent for PopupField
- Add dynamic toggle thumb colors using Primary/Secondary tokens
- Update BootstrapEditorUI and PanelUI to use generic components
- Remove unused JFormSection.cs and PopupFieldStyleHelper.cs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
Copilot AI review requested due to automatic review settings January 29, 2026 01:14
@JasonXuDeveloper JasonXuDeveloper enabled auto-merge (squash) January 29, 2026 01:14
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 29, 2026

Unity Test Results

EditMode: All tests passed
PlayMode: All tests passed

Unity Version: 2022.3.55f1
Project Path: UnityProject

✅ All tests passed! The PR is ready for review.

View workflow run

Click here to view the full workflow run

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the JEngine UI theming system to improve code organization, type safety, and user experience. The changes consolidate duplicate styling code, introduce generic components for better type safety, and add USS-based cursor support for improved UX.

Changes:

  • Refactored Tokens.cs with a base Palette class to eliminate color duplication and improve maintainability
  • Added shared input styling methods to JTheme.cs for consistent form control appearance across all components
  • Made JDropdown generic with a ForEnum<T>() factory method, enabling type-safe enum handling without string conversions
  • Added JIconButton component for small transparent icon buttons used in toolbars
  • Implemented USS-based cursor styles (pointer for clickables, text for inputs) with proper stylesheet integration
  • Updated hover effects to use PointerOverEvent/PointerOutEvent for better compatibility with PopupField internals
  • Added dynamic toggle thumb colors using Primary/Secondary tokens for better visual contrast
  • Updated BootstrapEditorUI and PanelUI to use new generic components, eliminating EnumHelpers dependencies
  • Removed unused JFormSection.cs and PopupFieldStyleHelper.cs files

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Tokens.cs Refactored with Palette base class to centralize color definitions and reduce duplication
JTheme.cs Added shared input styling methods (ApplyInputContainerStyle, ApplyInputElementStyle, etc.) and cursor utilities
components.uss Added USS cursor classes and JDropdown styles with hover states
tokens.uss Added --j-bg-input CSS variable for input backgrounds
JDropdown.cs Made generic with ForEnum<T>() factory, replaced polling-based styling with direct application
JIconButton.cs New component for small icon buttons with transparent backgrounds
JTextField.cs Refactored to use shared JTheme styling methods
JObjectField.cs Made generic, removed non-generic version, uses shared styling methods
JToggle.cs Added dynamic thumb colors based on state for better visual feedback
JButton.cs, JToggleButton.cs Added pointer cursor support and token usage consistency
JBreadcrumb.cs Changed hover color to use BgSurface instead of BgHover
JLogView.cs Changed background to BgInput for consistent control styling
JFormField.cs Changed font size to use Tokens.FontSize.Sm token
PanelUI.cs Updated to use generic JDropdown<T> and JObjectField<T>, replaced custom icon button code with JIconButton
BootstrapEditorUI.cs Updated to use generic components, eliminated EnumHelpers usage
PopupFieldStyleHelper.cs Removed - functionality replaced by USS styles and JTheme methods
JFormSection.cs Removed - unused component

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Address Copilot review feedback - always use formatter constructor
instead of conditional branches.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved: Copilot review found no issues and Unity Tests passed (or were skipped for non-code changes).

@JasonXuDeveloper JasonXuDeveloper merged commit 35f28a9 into master Jan 29, 2026
17 checks passed
@JasonXuDeveloper JasonXuDeveloper deleted the refactor/ui-theming-improvements branch January 29, 2026 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants